Table lookup mechanism for address resolution

ABSTRACT

A table lookup indexing system for the transmission of data packets in a network switch. Data is received in an input port and is divided into two parts, an index portion and a bucket portion. The index portion selects a particular bucket and the combination of the index portion and bucket portion selects a specific entry in the table.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a divisional of U.S. patent application Ser. No.09/714,273, filed Nov. 17, 2000, entitled “TABLE LOOKUP MECHANISM FORADDRESS RESOLUTION,” which claims the benefit of U.S. Provisional PatentApplication No. 60/166,225 filed on Nov. 18, 1999. The contents of whichare incorporated by reference herein in its entirety.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention is directed to a method and apparatus for a tablelookup index that provides access to a table, such as an addressingtable, in a fast and efficient manner. More specifically the tablelookup index is for the transmission of data packets in a networkswitch.

2. Description of the Prior Art

In the world of data transmission it is necessary to transmit data asquickly as possible, in order to have almost instantaneous access toinformation.

Table lookups are frequently used to index information to give quickaccess to much needed data. For example in network switching it isimperative that when data is received in a port the appropriate port foroutput be identified in order to transfer data. Therefore table lookupsare utilized to store information regarding incoming data that directsthe incoming data to an appropriate port for output.

In the field of table look-ups there are several methods used to accessinformation. One method is a linear index.

FIG. 1B illustrates a 64K table 100 that is linearly indexed. Index 105for a 64K table is required to be 16 bits long (2¹⁶=64K) to linearlyaccess entries in the table. Since the index linearly accesses entriesin the table, there is a one to one correspondence between each indexand each table entry (i.e. each index has a corresponding table entry).

FIG. 1C is an illustration of a linear index into a 64K table. IndexesI(1), I(2), I(3) . . . are each linearly indexed into the 64K tablegiving a one to one correspondence between each index and each tableentry. If indexes I(1), I(2), I(3) . . . each are 16 bits long an entrycan be found in 16 clock cycles using standard binary searching.However, when a new address must be learned by inserting an entry ordeleting an entry, it will take a long time to delete or insert theaddress from or to the table because the index must be sorted after eachinsertion and each deletion. In the worst case scenario each of thesixteen bit address indexes will have to be moved and sorted which willbe time consuming. This sorting greatly degrades the performance of theswitch. When the new address is inserted into the table, addresses willhave to be moved up and/or down in order to make room for the newaddress. Therefore as the table size increases, the performance of theswitch degrades.

Other methods make use of pointers, hash functions or tree functions toremedy the problem. Most of these methods, when implemented, have a“bad” worst case performance—particularly for insert and deleteoperations. As noted above, as the size of the table increases,performance becomes degraded. Some of the main reasons for the poorresults are that the table size directly affects performance and themethods require extra storage and data structures.

SUMMARY OF THE INVENTION

The present invention is designed to overcome the deficiencies of theprior art and to increase the speed of data transmission.

In one embodiment, the present invention is a method of performing atable look-up. The method has the steps of receiving data through aninput source; parsing the data into an index portion and a correspondingbucket portion; indexing the index portion to the corresponding bucketportion; and accessing table information stored in a look-up table usingthe bucket portion.

In another embodiment, the present invention is a table look-up indexingdevice. The table look-up indexing device has a receiver that receivesincoming data; a data parser that parses the data into an index portionand a corresponding bucket portion; an indexer that indexes the indexportion to the bucket portion; and a lookup device that accesses alook-up table using the corresponding bucket portion.

In a further embodiment, the present invention is a network switchhaving multiple ports used for receiving and exporting data. Each of themultiple ports are connected to one another through a communicationsmedium. Multiple Address Resolution Logic (ARL) devices are connected toone of the multiple ports so that each of the multiple ports has acorresponding ARL device. Each of said multiple ARL devices is made upof a parser that parses data into an index portion and a correspondingbucket portion; an indexer that indexes said index portion to acorresponding bucket portion; and a look-up device that accesses tableentries in a look-up table using the bucket portion.

BRIEF DESCRIPTION OF THE DRAWINGS

The objects and features of the invention will be more readilyunderstood with reference to the following description and the attacheddrawings, wherein:

FIG. 1A is an illustration of a network switch having look-up tables (LTables) and Address Resolution Logic (ARL);

FIG. 1B is an illustration of a 16 bit index and a 64K table of theprior art;

FIG. 1C is an illustration of a linear index into a 64K table of theprior art;

FIG. 2A is an illustration of a 48 bit key being parsed into and indexportion and a bucket portion to select a particular entry in a 64Ktable;

FIG. 2B is an illustration of indexing a 64K table using an indexportion and a bucket portion for multiple indexes;

FIG. 3 is an illustration of a 48 bit key having a bucket size of 32 andbeing indexed into a 64K table;

FIG. 4A is an illustration of the method steps of an embodiment of thepresent invention.

FIG. 4B is an illustration of the method steps of another embodiment ofthe present invention.

FIG. 5 is an illustration of a network switch receiving an address andusing an index portion and bucket portion to identify a particular entryin a table to determine the appropriate output port for datatransmission.

FIG. 6 is an illustration of a network switch in accordance with thepresent invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

The present invention is a method and apparatus that performs a tablelook-up that parses incoming data into an index portion and a bucketportion and uses the index portion and bucket portion to do a look-up.

FIG. 1A illustrates a network switch 50 having 5 ports, 52, 54, 56, 58and 60. Each of the 5 ports have corresponding switching tables 62, 64,66, 68 and 70, respectively. Each of the switching tables 62, 64, 66, 68and 70 has Address Resolution Logic (ARL) and Lookup Tables (L Tables).Each of the 5 ports are connected to one another through acommunications line 72.

When data is received by one of the ports 52, 54, 56, 58 or 60 the datais indexed by the corresponding ARL. Simultaneously the data is sent toall the ports to determine which port the data should be sent to foroutput. When the output port is determined the ARL stores the outputport data in the L Table using the index. In this way the output portfor a particular type of data is “learned”.

Once the output port for a particular type of data is “learned”, when aport receives data, the ARL indexes the data and “looks up” the properoutput port in the look-up table, L Table. The data is then sent to theappropriate port for output and the step of sending data to every portis eliminated thereby speeding up the switching process.

For Example, suppose initial data is received by port 52 and is to beoutput through port 60. Initially data is sent to all the ports todetermine the proper output port. When the proper output port isdetermined, the initial data is sent to switching table 62 to be indexedby the ARL and the output port data is stored in the look-up table, LTable using the index created by the ARL. In the present case the LTable contains output port data directing any data with a particularindex to be sent to port 60.

When port 52 receives subsequent data, switching table 62 indexes thedata and “looks up” the index in the look-up table, L Table. If thesubsequent data has the same index as the initial data and is found inthe look-up table, the look-up table will show that the subsequent datashould be sent to port 60 for output and the subsequent data will beautomatically sent to port 60 for output.

If the subsequent data is indexed and the index is not found in thelook-up table, the subsequent data will be sent to all ports todetermine the appropriate output port. The subsequent data will then beindexed and the output port information stored in a look-up table byswitching table 62. The subsequent data is now “learned” and the nexttime incoming data comes in with the same index as the subsequent data,the incoming data will be immediately sent to the proper port for outputsince the data or index is now “learned”.

FIG. 2A illustrates a data structure 200 made up of 48 bits used as datafor being received by ports 52, 54, 56, 58 and 60. This 48 bit datastructure 200, commonly referred to as a key, is typically some type ofaddress that is parsed into multiple groups. In the present case thedata structure depicted in FIG. 2A is parsed into 3 segments; segment M,index segment I and bucket segment N. Bucket segment N is designated asthe bucket, index segment I is designated as the index, and segment M isthe remaining bits of the key.

For a key size of 48 and a table size of 64K, 16 bits are used forindexing. The 48 bit key is parsed into 3 segments, segment M, indexsegment I and bucket segment N.

FIG. 2B is an illustration of an index segment I(1) linearly indexed toa bucket segment N(1), an index segment I(2) linearly indexed to abucket segment N(2) and an index segment I(3) linearly indexed to abucket segment N(3) . . . . Each index segment I selects a bucketsegment N and the combination of index segment I and index segment Nselects an entry in the table. Each bucket segment N can be programmedto have a particular size. Since the size of index segment I isdependent upon the size of bucket segment N, the size of index segment Iwill change accordingly.

FIG. 3 illustrates a 48 bit key having a bucket size of 32 (i.e. bucketsegment N is 5 bits long and 2⁵=32) for a 64K table. Since it takes 16bits (64K=2¹⁶) to index the 64K table and the bucket size is 32 (5 bitslong), index segment I is 11 bits long (16 bits−5 bits=11 bits) andsegment M is 32 bits long (48 bits−16 bits=32 bits).

Index segment I is called the index and is linearly indexed to a bucketwhich is designated as a bucket segment N. The combination of the indexand bucket directly selects an entry in the table. Therefore once theindex is selected it will take a maximum of five clock cycles to searchthe bucket and only 5 bits will have to be binary sorted for an insertor delete operation. Thus an insert or delete function is dependent onthe bucket size which can be programmed to fit a particular need.

It is noted that in some instances it is important to select bits from akey for index segment I that will have recurring index segments I forall incoming keys. This will allow for bucket sizes of 2 or greaterwhich is more desirable for high speed switching.

In some applications manufacturers of chips use a manufacturersidentification number as part of the key. Therefore it may be valuableto use bits in the key used for the manufacturers identification numberas part of the index segment I. Another useful method for indexing indexsegment I is to use an XOR index where the index is XORed with theremaining bits of the key.

FIG. 4A is an illustration of the steps needed to index a look-up tablein accordance with the present invention. In step 410 data is receivedas input. The data is then parsed, in step 420, into an index portionand a corresponding bucket portion. In step 430 the index portion isindexed to the bucket portion. In step 440 table information stored in alook-up table is accessed using the bucket portion.

FIG. 4B has very similar steps to the steps illustrated in FIG. 4A. Instep 450 data is received in a port. The data is then parsed, in step460, into an index portion and a corresponding bucket portion. In step470 the index portion is indexed to the bucket portion. The majordifference from the steps illustrated in FIG. 4A and those illustratedin FIG. 4B is the following final step. In step 480 table informationstored in a look-up table is accessed using the bucket portion. However,if there is no table information stored in the look-up table for thebucket portion, the present invention stores table information into thelook-up table corresponding to the bucket portion as depicted in step490.

In one embodiment of the invention a MAC address is received in a portof a network switch having multiple ports. The MAC address is parsedinto an index portion and a bucket portion. The index portion is indexedto a bucket portion and the bucket portion is used to access a tableentry in a look-up table to determine which port the MAC address andassociated data should be sent to for output. If there is a table entryfor the corresponding bucket portion the MAC address and associated datawill be sent to the proper port for output. In the case where there isno table entry the port for output has to be “learned”. This isaccomplished by sending the MAC address to all ports in the switch. Theproper port for output will send a message back that it is the properport for output and this information is stored in the look-up table withthe corresponding bucket. Therefore any subsequent MAC addresses havingthe same index and bucket will be able to access the table entry in thelook-up table to determine the proper port for output without sendingthe MAC address to all the ports in the switch.

FIG. 5 is an illustration of a switch 500. In order to transmit data ata very quick and efficient manner switch 500 learns which output porteach incoming MAC addresses 505 is to be transmitted and stores thisinformation in table 510. When a new MAC address 505 is received byswitch 500, the MAC address is looked-up in table 510 and switched tothe proper destination output port 540 or 545.

An address 505 is received by switch 500 through an input port 515. Theinput port 515 transmits address 505 to parser 520. Parser 520 segmentsaddress 505 into three parts, segment 525 labeled as M, segment 530labeled as I and segment 535 labeled as N. Segment I is linearly indexedto a bucket 535 and bucket 535 directly indexes a entry in table 510. Ineffect bucket 535 does a look up in table 510 in order to determinewhich of output ports 540 or 545 are to be used to transmit incomingdata. The Index I merely selects a bucket.

FIG. 6 is an illustration of a network switch 600 having a port 605, aport 610 and a port 615. Each of these ports are connected to oneanother through a communications line 620.

Port 605 has a corresponding Address Resolution Logic device (ARL) 625and a corresponding look-up table 630. ARL 625 is made up of a parser635, an indexer 640 and a look-up device 645.

Port 610 has a corresponding Address Resolution Logic device (ARL) 650and a corresponding look-up table 655. ARL 650 is made up of a parser660, an indexer 665 and a look-up device 670.

Port 615 has a corresponding Address Resolution Logic device (ARL) 675and a corresponding look-up table 680. ARL 675 is made up of a parser685, an indexer 690 and a look-up device 695.

In the event that port 605 receives a MAC address to be sent to port610, the operation of the switch is as follows. A MAC address isreceived in port 605 of network switch 600 having multiple ports 605,610 and 615. The MAC address is sent to ARL 625 to be processed. Parser635 parses the MAC address into an index portion and a bucket portion.Indexer 640 indexes the index portion to a bucket in look-up 645. Thebucket portion in look-up 645 is used to access a table entry in look-uptable 630 to determine which port the MAC address and associated datashould be sent to for output. If there is a table entry for thecorresponding bucket portion the MAC address and associated data will besent to the proper port for output. In this case the look-up table entrywill direct the MAC address and associated data to output port 610.However, if there is no table entry the port for output has to be“learned”. This is accomplished by sending the MAC address to all ports,ports 605, 610 and 615, in switch 600. The proper port for output willsend a message back that it is the proper port for output and thisinformation is stored in look-up table 630 with the correspondingbucket. In this case port 610 will send port 605 a signal indicatingthat port 610 is the proper port for output and this information isstored in look-up table 630. Therefore any subsequent MAC addresseshaving the same index and bucket will be able to access the table entryin the look-up table to determine the proper port for output withoutsending the MAC address to all the ports in the switch.

An advantage of the present invention is that insert and deleteoperations will no longer be dependent upon table size. As discussedabove, address look-ups in the prior art are dependent upon table size.Therefore if the table size is 64K the index will be 16 bits long. Thusan insert or delete operation will involve sorting and moving 16 bitindexes.

However, the present invention for a 64K table with a bucket size of 32(5 bits) will only have an 11 bit index (16 bits−5 bits=11 bits).Therefore once a bucket is selected by an index, insert or deleteoperations will depend on the bucket size and involve the sorting andmoving of, in this case, 5 bit bucket indexes which is much moreefficient than the sorting and moving of 16 bit indexes.

Although the invention has been described based upon the embodimentsdiscussed above, it would be apparent to those skilled in the art thatcertain modifications, variations and alternative constructions would beapparent, while remaining within the spirit and scope of the invention.For example instead of using a linear index an XOR index is appropriatein certain circumstances. Likewise the bucket and index sizes areprogrammable to accommodate different circumstances and be tailored tospecific needs.

1. (canceled)
 2. An apparatus for performing a table look-up in anetwork device comprising: means for receiving a data packet through aninput port of the network device; means for parsing said data packetinto an index portion and a corresponding bucket portion; means forindexing, directly, said index portion to said corresponding bucketportion; and means for accessing address table information stored in anaddress look-up table using said bucket portion.
 3. The apparatus ofclaim 2 wherein said means for indexing said index portion to saidbucket portion comprises means for linearly indexing said index portionto said bucket portion.
 4. The apparatus of claim 2 wherein said meansfor indexing said index portion to said bucket portion comprises meansfor XOR indexing said index portion to said bucket portion.
 5. Theapparatus of claim 2 and further comprising means for sorting saidbucket portion.
 6. The apparatus of claim 2 and further comprising meansfor binary sorting said bucket portion.
 7. The apparatus of claim 2wherein said means for parsing said data packet into an index portionand a corresponding bucket portion further comprises means for parsingsaid index portion so that said index portion will recur when other datais parsed into said index portion and said corresponding bucket portion.8. The apparatus of claim 2 and further comprising means for storinginformation regarding said data in said address look-up table as addresstable information when no address table information is available usingsaid bucket portion to access address table information.
 9. A methodcomprising: receiving data including a MAC address at a port of anetwork switch having multiple ports; parsing the MAC address into anindex portion and a bucket portion; indexing the index portion to thebucket portion; and accessing an entry in a look-up table based on thebucket portion to determine which port of the multiple ports the datashould be sent for output.
 10. The method of claim 9 and furthercomprising storing information regarding said data in said addresslook-up table as address table information when no address tableinformation is available using said bucket portion to access addresstable information.
 11. The method of claim 9 and further comprising:determining that there is no entry in the look-up table based on thebucket portion; sending the MAC address to multiple ports on the networkswitch, when there is no entry in the look-up table based on the bucketportion; receiving a message from a responding port of the networkswitch indicating that the responding port is the port for outputtingdata corresponding to the bucket portion; and adding an entry in thelook-up table indicating that the responding port corresponds to thebucket portion.
 12. An apparatus comprising: means for receiving dataincluding a MAC address at a port of a network switch having multipleports; means for parsing the MAC address into an index portion and abucket portion; means for indexing the index portion to the bucketportion; and means for accessing an entry in a look-up table based onthe bucket portion to determine which port of the multiple ports thedata should be sent for output.
 13. The apparatus of claim 12 andfurther comprising means for storing information regarding said data insaid address look-up table as address table information when no addresstable information is available using said bucket portion to accessaddress table information.
 14. The apparatus of claim 12 and furthercomprising: means for determining that there is no entry in the look-uptable based on the bucket portion; means for sending the MAC address tomultiple ports on the network switch, when there is no entry in thelook-up table based on the bucket portion; means for receiving a messagefrom a responding port of the network switch indicating that theresponding port is the port for outputting data corresponding to thebucket portion; and means for adding an entry in the look-up tableindicating that the responding port corresponds to the bucket portion.